﻿using RestSharp;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Ymatou.ServiceCenter;

namespace YmtAuth.Dto
{
    /// <summary>
    /// IP区域认证管理请求类dto
    /// </summary>
    [Resource("auth.ymatou.com", "/json/reply/IpAreaAuthManageRequestDto", Method.GET, ParameterBuildType.UrlQueryString)]
    public class IpAreaAuthManageRequestDto
    {
        /// <summary>
        /// 用户ID
        /// </summary>
        public int UserId { get; set; }

        public string Country { get; private set; }
        public string Province { get; private set; }
        public string City { get; private set; }

        public override string ToString()
        {
            StringBuilder sb = new StringBuilder(" IpAreaAuthManageRequestDto Parameters: ");
            sb.AppendFormat("UserId: {0}, ", UserId);
            sb.AppendFormat("Country: {0}, ", Country);
            sb.AppendFormat("Province: {0}, ", Province);
            sb.AppendFormat("City: {0}, ", City);

            string str = sb.ToString();
            return str.Length > 1000 ? str.Substring(0, 1000) : str;
        }

        public string GetArea()
        {
            return string.Format("{0}|{1}|{2}", Country, Province, City);
        }
     }
}
